export default {
	getData_phone(phone){
		let that = this
		that.$httpRequest.get({
			that: that,
			url: 'h5/searchUserByPhone',
			params: {
				phone,
			},
			success: res => {
				if (res.code === that.$httpConfig.SUCCESS_CODE) {
					that.user = res.data
						
				}
			
			}
		})
		
	},
	getData_userId(userId){
		let that = this
		that.$httpRequest.get({
			that: that,
			url: 'h5/getUserInfo',
			params: {
				userId,
			},
			success: res => {
				if (res.code === that.$httpConfig.SUCCESS_CODE) {
					that.user = res.data
						
				}
			
			}
		})
		
	},
	submit(){
		let that = this
		that.$httpRequest.request({
			that: that,
			url: 'h5/follow',
			params: {
				followUserId:that.user.id,
				greetContent:that.netData
			},
			success: res => {
				if (res.code === that.$httpConfig.SUCCESS_CODE) {
					that.$toast.msg('发送成功', {
					    icon: 1
					})
					setTimeout(()=>{
						uni.navigateBack({
							delta:2
						})
					},500)	
				}else{
					that.$toast.alert({
						content: res.message,
						callback: result => {
							
						}
					})
				}
				
			}
		})
	}
}
